add_custom_target(hccl-0.1.0-py3-none-any.whl ALL
    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dist/hccl-0.1.0-py3-none-any.whl
)

# 读取sys_version.conf中版本号并打包到whl包中的hccl目录下
file(STRINGS ${TOP_DIR}/build/product/onetrack/sys_version/sys_version.conf  SYS_VERSION)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sys_version.py.in ${CMAKE_CURRENT_BINARY_DIR}/hccl/sys_version.py @ONLY)

add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dist/hccl-0.1.0-py3-none-any.whl
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/setup.py ${CMAKE_CURRENT_BINARY_DIR}
    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/hccl ${CMAKE_CURRENT_BINARY_DIR}/hccl
	
    COMMAND ${HI_PYTHON} setup.py bdist_wheel
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dist/hccl-0.1.0-py3-none-any.whl
    DESTINATION lib OPTIONAL
)
